import {
  observable,
  action
} from "mobx-miniprogram";
import {
  getStorage,
  setStorage
} from '@/utils/storage'

const userStore = observable({
  token: getStorage('user.token') || '',
  userInfo: getStorage('userInfo') || {},
  setToken: action(function (token) {
    this.token=token
  }),
  setUserInfo: action(function (user) {
    this.userInfo=user
  })
})

export default userStore